#!/bin/bash

installDocker(){
   cd ../soft
   yum install -y docker-ce-18.03.1.ce-1.el7.centos.x86_64.rpm
}

startDocker(){
systemctl start docker
systemctl enable docker
}

setReposDocker(){
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
 "registry-mirrors": ["https://hn3r3cl0.mirror.aliyuncs.com"]
} 
EOF
systemctl daemon-reload
systemctl restart docker
}

main(){
  installDocker
  startDocker
  setReposDocker
}
main
